import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/Home'
import ShowEms from '@/components/ShowEms'
//获取原型对象上的push函数
const originalPush = Router.prototype.push
//修改原型对象中的push方法
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Home',
      component: Home,
      children:[
        {
          path: '/showEms',
          name: 'ShowEms',
          component: ShowEms
        }
      ]
    }
  ]
})
